<template>
    <div>
        <el-card class="main-card">
            <el-row>
                <el-col :span="9">
                    <el-input
                            placeholder="请输入体检人姓名或套餐名称"
                            clearable
                            v-model="queryInfo.queryString"
                            @clear="findPage"
                    >
                        <el-button
                                slot="append"
                                icon="el-icon-search"
                                @click="findPage"
                        ></el-button>
                    </el-input>
                </el-col>
                <el-col :span="2">
                    <el-button
                            @click="insert"
                            style="margin-left: 10px"
                            type="primary"
                    >新增体质评估</el-button
                    >
                </el-col>
            </el-row>
            <el-table
                    :data="tableList"
                    stripe
                    border
                    highlight-current-row
                    v-loading="loading"
                    element-loading-text="拼命加载中"
                    element-loading-spinner="el-icon-loading"
                    max-height="450"
            >
                <el-table-column type="index" label="序号" width="80">
                </el-table-column>
                <el-table-column prop="meName" label="预约用户姓名"> </el-table-column>
                <el-table-column prop="seName" label="预约套餐名称"> </el-table-column>
                <el-table-column prop="somatization" label="躯体化程度" ></el-table-column>
                <el-table-column prop="obco" label="强迫症状程度" ></el-table-column>
                <el-table-column prop="interSen" label="人际关系敏感度" ></el-table-column>
                <el-table-column prop="depression" label="抑郁程度" ></el-table-column>
                <el-table-column prop="anxiety" label="焦虑程度" ></el-table-column>
                <el-table-column prop="hostility" label="敌对程度" ></el-table-column>
                <el-table-column prop="phobicAn" label="恐怖程度" ></el-table-column>
                <el-table-column prop="parIdeation" label="偏执程度" ></el-table-column>
                <el-table-column prop="psychoticism" label="精神病性程度" ></el-table-column>
                <el-table-column prop="assessor" label="健康员"> </el-table-column>
                <el-table-column prop="evDate" label="评估日期"> </el-table-column>
                <el-table-column prop="remark" label="评估说明"> </el-table-column>
                <el-table-column fixed="right" label="操作" width="80">
                    <template slot-scope="scope">
                        <el-button
                                @click="updateById(scope.row)"
                                type="primary"
                                icon="el-icon-edit"
                                size="small"
                        ></el-button>
                    </template>
                </el-table-column>
                <el-table-column fixed="right" label="查看详情" width="80">
                    <template slot-scope="scope">
                        <el-button
                                @click="openXq(scope.row)"
                                type="success"
                                icon="el-icon-s-check"
                                size="small"
                        ></el-button>
                    </template>
                </el-table-column>
            </el-table>
            <div class="block">
                <el-pagination
                        @size-change="handlePageSize"
                        @current-change="handlePageNumber"
                        background
                        :current-page="queryInfo.pageNumber"
                        :page-sizes="[8, 16, 32, 64, 128]"
                        :page-size="queryInfo.pageSize"
                        layout="total, sizes, prev, pager, next, jumper"
                        :total="total"
                >
                </el-pagination>
            </div>
        </el-card>
        <!-- 表单添加/修改 -->
        <el-dialog
                :title="title"
                :visible.sync="open"
                @close="dialogClose"
                width="75%"
        >
            <el-tabs
                    type="border-card"
                    v-model="activeName"
                    @tab-click="handleClick1"
            >
                <el-tab-pane label="预约信息" name="first">
                    <el-row :gutter="20">
                        <el-col v-if="this.editSelectStatus === true" :span="2">
                            <div style="margin-top: 10px"> 预约Id :</div>
                        </el-col>
                        <el-col :span="6">
                            <el-select v-if="this.editSelectStatus === true" v-model="checkOrderIds" placeholder="请选择预约Id">
                                <el-option
                                        v-for="(item, index) in checkOrderList"
                                        :key="index"
                                        :label="item.member_id"
                                        :value="item.id"
                                        @click.native="findByOrderId(item)">
                                </el-option>
                            </el-select>
                        </el-col>
                        <el-col :span="10">
                            <el-form v-if="orderFromStatus === true" :model="orderForm" ref="orderForm" label-width="80px">
                                <el-form-item label="预约Id" prop="id" >
                                    <el-input v-model="orderForm.id" disabled/>
                                </el-form-item>
                                <el-form-item label="会员Id" prop="memberId" >
                                    <el-input v-model="orderForm.memberId" disabled/>
                                </el-form-item>
                                <el-form-item label="预约日期" prop="orderDate" >
                                    <el-input v-model="orderForm.orderDate" disabled/>
                                </el-form-item>
                                <el-form-item label="到诊状态" prop="orderStatus" >
                                    <el-input v-model="orderForm.orderStatus" disabled/>
                                </el-form-item>
                                <el-form-item label="预约类型" prop="orderType" >
                                    <el-input v-model="orderForm.orderType" disabled/>
                                </el-form-item>
                                <el-form-item label="套餐Id" prop="setmealId" >
                                    <el-input v-model="orderForm.setmealId" disabled/>
                                </el-form-item>
                                <el-form-item label="评估状态" prop="evStatus" >
                                    <el-input v-model="orderForm.evStatus" disabled/>
                                </el-form-item>
                            </el-form>
                        </el-col>
                    </el-row>
                </el-tab-pane>

                <el-tab-pane v-if="xq === true" label="预约套餐" name="two1">
                    <el-form v-if="xq === true" :model="stemealForm" :rules="rules" ref="stemealForm" label-width="80px">
                        <el-row :gutter="20">
                            <el-col :span="8">
                                <el-form-item label="套餐名称" prop="name">
                                    <el-input disabled v-model="stemealForm.name" />
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="套餐编码" prop="code">
                                    <el-input disabled v-model="stemealForm.code" />
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="助记码" prop="helpCode">
                                    <el-input disabled v-model="stemealForm.helpCode" />
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row :gutter="20">
                            <el-col :span="8">
                                <el-form-item label="适用性别" prop="sex">
                                    <el-input disabled v-model="stemealForm.sex" />
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="适用年龄" prop="age">
                                    <el-input disabled v-model="stemealForm.age" />
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="套餐说明" prop="remark">
                                    <el-input disabled v-model="stemealForm.remark" />
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="注意事项" prop="attention">
                                    <el-input disabled v-model="stemealForm.attention" />
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="套餐图片" prop="img">
                                    <el-input disabled v-model="stemealForm.attention" />
                                </el-form-item>
                            </el-col>
                        </el-row>
                    </el-form>
                    <el-tabs
                            type="border-card"
                            v-model="activeName1"
                            @tab-click="handleClick">
                        <el-tab-pane label="检查组信息" name="second">
                            <el-table
                                    :data="groupTableList"
                                    stripe
                                    border
                                    highlight-current-row
                                    max-height="450"
                            >
                                <el-table-column type="index" label="序号" width="80">
                                </el-table-column>
                                <el-table-column prop="code" label="检查组编码" width="180">
                                </el-table-column>
                                <el-table-column prop="name" label="检查组名称">
                                </el-table-column>
                                <el-table-column prop="age" label="助记码"> </el-table-column>
                                <el-table-column
                                        prop="sex"
                                        label="适用性别"
                                        :formatter="formatSex"
                                >
                                </el-table-column>
                                <el-table-column prop="remark" label="检查项目说明">
                                </el-table-column>
                                <el-table-column prop="attention" label="检查项目注意事项">
                                </el-table-column>
                            </el-table>
                        </el-tab-pane>
                        <el-tab-pane label="检查项信息" name="three">
                            <el-table
                                    :data="itemTableList"
                                    stripe
                                    border
                                    highlight-current-row
                                    max-height="450"
                            >
                                <el-table-column type="index" label="序号" width="80">
                                </el-table-column>
                                <el-table-column prop="code" label="检查项目编码" width="180">
                                </el-table-column>
                                <el-table-column prop="name" label="检查项名称">
                                </el-table-column>
                                <el-table-column
                                        prop="sex"
                                        label="适用性别"
                                        :formatter="formatSex"
                                >
                                </el-table-column>
                                <el-table-column prop="age" label="适用年龄"> </el-table-column>
                                <el-table-column
                                        prop="type"
                                        label="检查项目类型"
                                        :formatter="formatType"
                                >
                                </el-table-column>
                                <el-table-column prop="remark" label="检查项目说明">
                                </el-table-column>
                                <el-table-column prop="attention" label="检查项目注意事项">
                                </el-table-column>
                            </el-table>
                        </el-tab-pane>
                    </el-tabs>
                </el-tab-pane>

                <el-tab-pane v-if="xq === true" label="会员信息" name="two2">
                    <el-form v-if="xq === true" :model="memberForm" :rules="rules" ref="xqForm" label-width="80px">
                        <el-row :gutter="20">
                            <el-col :span="8">
                                <el-form-item label="会员编号" prop="fileNumber">
                                    <el-input disabled v-model="memberForm.fileNumber" />
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="名称" prop="name">
                                    <el-input disabled v-model="memberForm.name" />
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="联系邮箱" prop="email">
                                    <el-input disabled v-model="memberForm.email" />
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row :gutter="20">
                            <el-col :span="8">
                                <el-form-item label="性别" prop="sex">
                                    <el-input disabled v-model="memberForm.sex" />
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="身份证号" prop="idCard">
                                    <el-input disabled v-model="memberForm.idCard" />
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="注册时间" prop="regTime">
                                    <el-input disabled v-model="memberForm.regTime" />
                                </el-form-item>
                            </el-col>
                        </el-row>
                    </el-form>
                </el-tab-pane>

                <el-tab-pane label="心理评估" name="three">
                    <el-form v-if="xq === false" :model="form" :rules="rules" ref="form" label-width="120px">
                        <el-row :gutter="20">
                            <el-col :span="8">
                                <el-form-item label="评估单号" prop="orderId">
                                    <el-select v-model="form.orderId" placeholder="请选择评估单号">
                                        <el-option
                                                v-for="(item, index) in checkOrderList"
                                                :key="index"
                                                :label="item.orderId"
                                                :value="item.id"
                                        >
                                        </el-option>
                                    </el-select>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="健康员" prop="assessor">
                                    <el-select v-model="form.assessor" placeholder="请选择健康员">
                                        <el-option
                                                v-for="(item, index) in assessorList"
                                                :key="index"
                                                :label="item.nickName"
                                                :value="item.nickName"
                                                @click.native="dy(item)"
                                        >
                                        </el-option>
                                    </el-select>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="评估日期" prop="evDate">
                                    <template>
                                        <el-date-picker
                                                v-model="form.evDate"
                                                align="right"
                                                type="date"
                                                format="yyyy 年 MM 月 dd 日"
                                                value-format="yyyy-MM-dd"
                                                placeholder="请选择评估日期"
                                        >
                                        </el-date-picker>
                                    </template>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="26">
                                <el-form-item label="躯体化程度" prop="somatization">
                                    <el-radio-group v-model="form.somatization">
                                        <el-radio label="正常">正常</el-radio>
                                        <el-radio label="轻度">轻度</el-radio>
                                        <el-radio label="中度">中度</el-radio>
                                        <el-radio label="偏重">偏重</el-radio>
                                        <el-radio label="严重">严重</el-radio>
                                    </el-radio-group>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="26">
                                <el-form-item label="强迫症状程度" prop="obco">
                                    <el-radio-group v-model="form.obco">
                                        <el-radio label="正常">正常</el-radio>
                                        <el-radio label="轻度">轻度</el-radio>
                                        <el-radio label="中度">中度</el-radio>
                                        <el-radio label="偏重">偏重</el-radio>
                                        <el-radio label="严重">严重</el-radio>
                                    </el-radio-group>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="26">
                                <el-form-item label="人际关系敏感度" prop="interSen">
                                    <el-radio-group v-model="form.interSen">
                                        <el-radio label="正常">正常</el-radio>
                                        <el-radio label="轻度">轻度</el-radio>
                                        <el-radio label="中度">中度</el-radio>
                                        <el-radio label="偏重">偏重</el-radio>
                                        <el-radio label="严重">严重</el-radio>
                                    </el-radio-group>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="26">
                                <el-form-item label="抑郁程度" prop="depression">
                                    <el-radio-group v-model="form.depression">
                                        <el-radio label="正常">正常</el-radio>
                                        <el-radio label="轻度">轻度</el-radio>
                                        <el-radio label="中度">中度</el-radio>
                                        <el-radio label="偏重">偏重</el-radio>
                                        <el-radio label="严重">严重</el-radio>
                                    </el-radio-group>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="26">
                                <el-form-item label="焦虑程度" prop="anxiety">
                                    <el-radio-group v-model="form.anxiety">
                                        <el-radio label="正常">正常</el-radio>
                                        <el-radio label="轻度">轻度</el-radio>
                                        <el-radio label="中度">中度</el-radio>
                                        <el-radio label="偏重">偏重</el-radio>
                                        <el-radio label="严重">严重</el-radio>
                                    </el-radio-group>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="26">
                                <el-form-item label="敌对程度" prop="hostility">
                                    <el-radio-group v-model="form.hostility">
                                        <el-radio label="正常">正常</el-radio>
                                        <el-radio label="轻度">轻度</el-radio>
                                        <el-radio label="中度">中度</el-radio>
                                        <el-radio label="偏重">偏重</el-radio>
                                        <el-radio label="严重">严重</el-radio>
                                    </el-radio-group>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="26">
                                <el-form-item label="恐怖程度" prop="phobicAn">
                                    <el-radio-group v-model="form.phobicAn">
                                        <el-radio label="正常">正常</el-radio>
                                        <el-radio label="轻度">轻度</el-radio>
                                        <el-radio label="中度">中度</el-radio>
                                        <el-radio label="偏重">偏重</el-radio>
                                        <el-radio label="严重">严重</el-radio>
                                    </el-radio-group>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="26">
                                <el-form-item label="偏执程度" prop="parIdeation">
                                    <el-radio-group v-model="form.parIdeation">
                                        <el-radio label="正常">正常</el-radio>
                                        <el-radio label="轻度">轻度</el-radio>
                                        <el-radio label="中度">中度</el-radio>
                                        <el-radio label="偏重">偏重</el-radio>
                                        <el-radio label="严重">严重</el-radio>
                                    </el-radio-group>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="26">
                                <el-form-item label="精神病性程度" prop="psychoticism">
                                    <el-radio-group v-model="form.psychoticism">
                                        <el-radio label="正常">正常</el-radio>
                                        <el-radio label="轻度">轻度</el-radio>
                                        <el-radio label="中度">中度</el-radio>
                                        <el-radio label="偏重">偏重</el-radio>
                                        <el-radio label="严重">严重</el-radio>
                                    </el-radio-group>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="18">
                                <el-form-item label="评估说明" prop="remark">
                                    <el-input
                                            v-model="form.remark"
                                            type="textarea"
                                            placeholder="请输入评估说明"
                                            show-word-limit
                                            maxlength="800"
                                            :autosize="{ minRows: 5, maxRows: 30 }"
                                    />
                                </el-form-item>
                            </el-col>
                        </el-row>
                    </el-form>

                    <el-form v-if="xq === true" :model="xqForm" :rules="rules" ref="xqForm">
                        <el-row :gutter="20">
                            <el-col :span="8">
                                <el-form-item label="评估单号" prop="orderId">
                                    <el-select v-model="xqForm.orderId" disabled placeholder="请选择评估单号">
                                        <el-option
                                                v-for="(item, index) in checkOrderList"
                                                :key="index"
                                                :label="item.orderId"
                                                :value="item.id"
                                        >
                                        </el-option>
                                    </el-select>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="健康员" prop="assessor">
                                    <el-select v-model="xqForm.assessor" disabled placeholder="请选择健康员">
                                        <el-option
                                                v-for="(item, index) in assessorList"
                                                :key="index"
                                                :label="item.nickName"
                                                :value="item.nickName"
                                                @click.native="dy(item)"
                                        >
                                        </el-option>
                                    </el-select>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="评估日期" prop="evDate">
                                    <template>
                                        <el-date-picker disabled
                                                        v-model="xqForm.evDate"
                                                        align="right"
                                                        type="date"
                                                        format="yyyy 年 MM 月 dd 日"
                                                        value-format="yyyy-MM-dd"
                                                        placeholder="请选择评估日期"
                                        >
                                        </el-date-picker>
                                    </template>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="18">
                                <el-form-item label="评估说明" prop="remark">
                                    <el-input
                                            disabled
                                            v-model="form.remark"
                                            type="textarea"
                                            placeholder="请输入评估说明"
                                            show-word-limit
                                            maxlength="800"
                                            :autosize="{ minRows: 5, maxRows: 30 }"
                                    />
                                </el-form-item>
                            </el-col>
                        </el-row>
                    </el-form>
                </el-tab-pane>

            </el-tabs>

            <div slot="footer" class="dialog-footer">
                <el-button @click="clickCancel">取 消</el-button>
                <el-button type="primary" @click="clickOk">确 定</el-button>
            </div>
        </el-dialog>
    </div>
</template>

<script>
    import formatDate from '@/utils/formatDate';
    export default {
        data() {
            return {
                // 分页查询条件
                queryInfo: {
                    // 页码
                    pageNumber: 1,
                    // 页数
                    pageSize: 8,
                    // 关键字
                    queryString: null,
                },
                // 表格数据
                tableList: [],
                // 总记录数
                total: 0,
                // 表单标题
                title: null,
                // 是否打开对话框
                // 表格加载
                loading: false,
                open: false,
                // 评估表单数据
                form: {},
                // 预约信息表
                orderForm: {},
                // 会员信息表
                memberForm: {},
                stemealForm: {},
                // 评估详情展示
                xqForm: {},
                // 表单校验
                rules: {
                    label: [
                        { required: true, message: "请输入权限标签名称", trigger: "blur" },
                        {
                            min: 1,
                            max: 50,
                            message: "权限标签的长1 到 50 个字符",
                            trigger: "blur",
                        },
                    ],
                    value: [
                        { required: true, message: "请输入权限标签值", trigger: "blur" },
                        {
                            min: 1,
                            max: 20,
                            message: "权限标签的长1 到 20 个字符",
                            trigger: "blur",
                        },
                    ],
                    status: [
                        { required: true, message: "请选择启用状态", trigger: "change" },
                    ],
                },
                // 表单控制
                xq: null,
                activeName: "first",
                activeName1: "second",
                groupTableList: [],
                itemTableList: [],
                checkOrderIds: [],
                checkOrderList: [],
                imageUrl: null,
                orderFromStatus: false,
                // 修改页面选择器
                editSelectStatus: null,
                // 操作员
                assessorList: [],
            };
        },
        /** 页面初始化调用方法 */
        created() {
            this.findPage();
        },
        methods: {
            /** 分页查询 */
            findPage() {
                this.loading = true;
                this.$ajax.post("/mentalEvaluate/findPage", this.queryInfo).then((res) => {
                    console.log("查询数据",res);
                    this.loading = false;
                    this.tableList = res.data.data.rows;
                    this.total = res.data.data.total;
                });
            },
            /** 页面大小改变事件 */
            handlePageSize(newPageSize) {
                this.queryInfo.pageSize = newPageSize;
                this.findPage();
            },
            /** 页面改变事件 */
            handlePageNumber(newPageNumber) {
                // 将分页参数新数据传递给pageNumber(分页参数)
                this.queryInfo.pageNumber = newPageNumber;
                this.findPage();
            },
            /** 修改评估信息 */
            insert() {
                this.title = "新增评估";
                this.open = true;
                this.xq = false;
                this.editSelectStatus  = true;
                this.findOrderByEvStatus();
                this.findAssessor();
            },
            /** 打开详情对话框 */
            openXq(row){
                this.title = "查看详情";
                console.log("查看详情", row);
                this.xq = true;
                this.open = true;
                this.findById(row);
                this.findByOrderId1(row);
                this.findByMerId(row);
                this.findBySetId(row);
                this.findMeByMeId(row);
            },
            /** 修改评估信息 */
            updateById(row) {
                this.form = row;
                this.title = "修改评估";
                this.open = true;
                this.xq = false;
                console.log("修改",row);
                this.editSelectStatus = false;
                this.findByOrderId1(row);
            },
            /** 删除评估信息 */
            deleteById(id) {
                this.$confirm(
                    "您的操作将永久删除编号为{" + id + "}的数据, 是否继续?",
                    "提示",
                    {
                        confirmButtonText: "确定",
                        cancelButtonText: "取消",
                        type: "warning",
                    }
                )
                    .then(() => {
                        // 调后台退出接口
                        this.$ajax.delete(`/Permission/delete/${id}`).then((res) => {
                            this.$message.success(res.data.message);
                            this.queryInfo.pageNumber = 1;
                            this.findPage();
                        });
                    })
                    .catch(() => {
                        this.$message({
                            type: "info",
                            message: "已取消",
                        });
                    });
            },
            /** 关闭对话框事件 */
            dialogClose() {
                // 将表单进行重置，并移除校验效果
                this.$refs.form.resetFields();
                this.$refs.xqForm.resetFields();
                this.xq = null;
                this.editSelectStatus = null;
            },
            /** 点击取消 */
            clickCancel() {
                // 将表单进行重置，并移除校验效果
                this.form = {};
                this.open = false;
                this.xq = null;
                this.findPage();
                this.editSelectStatus = null;
            },
            /** 点击确定 */
            clickOk() {
                // 进行表单校验
                this.$refs.form.validate((valid) => {
                    // 校验不通过
                    if (!valid) {
                        return this.$message.error("表单校验失败,请检查后提交！");
                    }
                    // 校验通过
                    if (this.form.id === undefined || this.form.id === null) {
                        this.$message.success("提交");
                        this.$ajax.post("/mentalEvaluate/insert/", this.form).then((res) => {
                            this.$message.success(res.data.message);
                            this.open = false;
                            this.findPage();
                        });
                        console.log("this.form",this.form)
                    } else {
                        this.$ajax.put("/mentalEvaluate/update/", this.form).then((res) => {
                            this.$message.success(res.data.message);
                            this.open = false;
                            this.findPage();
                        });
                    }
                });
            },
            /** 根据评估Id 查询评估详情 */
            findById(row) {
                console.log(row.id);
            },
            /** 标签切换事件 */
            handleClick(tab, event) {
                console.log(tab, event);
            },
            handleClick1(tab, event){

            },
            /** 查询心理评估未完成的订单 */
            findOrderByEvStatus(){
                this.$ajax.post("/order/findMeEvStatus").then((res) => {
                    console.log("选择框信息",res);
                    this.checkOrderList = res.data.data
                });
            },
            /** 查询所有健康员姓名 */
            findAssessor(){
                this.$ajax.post("/bodyEvaluate/findAssessor").then((res) => {
                    console.log("健康员姓名",res);
                    this.assessorList = res.data.data
                });
            },
            /** 新增时适用 选择框根据orderId查询 */
            findByOrderId(item) {
                console.log("选择框", item);
                this.$ajax.post(`/order/findBodyEvaById/${item.id}`).then((res) => {
                    console.log("预约表单信息",res);
                    this.orderForm = res.data.data;
                    this.orderForm.orderDate = formatDate( res.data.data.orderDate, 'YYYY-MM-DD');
                    this.orderFromStatus = true;
                });
            },
            /** 修改时 根据orderId展示预约信息 */
            findByOrderId1(row) {
                this.$ajax.post(`/order/findBodyEvaById/${row.orderId}`).then((res) => {
                    this.orderForm = res.data.data;
                    this.orderForm.orderDate = formatDate( res.data.data.orderDate, 'YYYY-MM-DD');
                    this.orderFromStatus = true;
                });
            },
            /** 根据会员Id查询会员信息 */
            findByMerId(row) {
                this.$ajax.post(`/tMember/findByMerId/${row.memberId}`).then((res) => {
                    console.log("会员信息",res);
                    this.memberForm = res.data.data;
                });
            },
            /** 根据评估Id查询评估信息 */
            findMeByMeId(row) {
                console.log("测试",row);
                this.$ajax.post(`/mentalEvaluate/findMeByMeId/${row.orderId}`).then((res) => {
                    this.xqForm = res.data.data;
                });
            },
            /** 根据套餐Id查询套餐信息 */
            findBySetId(row) {
                this.$ajax.post(`/setmeal/findBySetId/${row.setmealId}`).then((res) => {
                    console.log("套餐信息",res);
                    this.stemealForm = res.data.data;
                    this.groupTableList = res.data.data.checkGroups;
                    this.itemTableList = res.data.data.checkItems;
                    this.imageUrl = res.data.data.img;
                });
            },
            /** 格式化性别 */
            formatSex(row) {
                if (row.sex === "1") {
                    return "男";
                } else if (row.sex === "2") {
                    return "女";
                } else {
                    return "不限";
                }
            },
            /** 格式化类型 */
            formatType(row) {
                if (row.type === "1") {
                    return "检验";
                } else if (row.type === "2") {
                    return "检查";
                }
            },

            /** 测试 */
            dy(item){
                console.log("健康员", item);
            },
        },
    };
</script>

<style scoped>
    .status-class {
        margin-left: -30%;
    }
</style>
